package com.changgou.goods.dao;

import com.changgou.goods.pojo.Brand;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @author 13545
 * @Description: Dao使用通用Mapper
 * @date 2020/10/31 14:38
 */
public interface BrandMapper extends Mapper<Brand> {

    /**
     * 根据分类ID查询品牌集合
     * @param categoryid
     * @return
     */
    @Select("select tb.id, tb.name, tb.image, tb.letter, tb.seq from tb_brand tb,tb_category_brand tcb where tb.id = tcb.brand_id and tcb.category_id = #{categoryid};")
    List<Brand> findByCategory(Integer categoryid);
}
